<template>
    <div>物联网金融系统-登录</div>

    <table>
        <tr>
            <td>用户名:</td>
            <td>
                <input type="text" v-model="name">
            </td>
        </tr>
        <tr>
            <td>密码:</td>
            <td>
                <input type="password" v-model="pwd">
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <input type="button" value="登录" @click="zouni">
            </td>
        </tr>
    </table>

</template>

<script setup lang="ts">

import {ref} from 'vue'

const name=ref('');
const pwd=ref('');
const zouni=()=>{
    if(!name.value||!pwd.value){
        alert("用户名和密码不能为空");
        return;
    }
    if(name.value!='Admin123'&&pwd.value!='Admin123'){
        alert("用户名和密码只能是Admin123");
        return;

    }
    if(name.value=='Admin123'&&pwd.value=='Admin123'){
        alert("添加成功");

        location.href="http://localhost:5173/Show";

    }

}


</script>